package com.giambo.caatdef;


import android.content.Context;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;


public class MockProvider extends Thread {
	
	
	private LocationManager mylocman;
	private String PippoMockProvider;
	@SuppressWarnings("unused")
	private Context ctx;
	
	
	
	

	public MockProvider(LocationManager mylocman, String PippoMockProvider, Context ctx){
		
		this.mylocman = mylocman;
		this.PippoMockProvider = PippoMockProvider;
		this.ctx = ctx;
		
	}
	
	
	
	@Override
    public void run() {
		//setto una Location di prova per "inizializzare" il thread una volta fatto partire con la chiamata start()
    	   /*Location LOCATION = new Location(PippoMockProvider);
    	   LOCATION.setLatitude(0.0);
    	   LOCATION.setLongitude(0.0);
    	   LOCATION.setAltitude(0.0);
    	   LOCATION.setTime(System.currentTimeMillis());
    	   LOCATION.setSpeed(0);
           mylocman.setTestProviderLocation(PippoMockProvider, LOCATION);*/
        }
	@Override
	public void start(){
		super.start();
	}
 
	public void setPosition(Double Latitude, Double Longitude, Double Altitude){
		Location location = new Location(PippoMockProvider);
        location.setLatitude(Latitude);
        location.setLongitude(Longitude);
        location.setAltitude(Altitude);
        location.setTime(System.currentTimeMillis());
        location.setSpeed(30);
        mylocman.setTestProviderLocation(PippoMockProvider, location);
        Log.d("Settaggio da Esterno", "Location passata " + location.toString());
		}

}

	

	